<div id="content-sidebar" class="col-md-4">
    <a href="<%= new_zerocms_admin_appearances_widgets_sidebar_path %>" title="<%= t('zerocms.admin.widgets.create_sidebar') %>" class="ajax_link btn btn-default" ><%= t('zerocms.admin.widgets.create_sidebar') %></a>
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="row">
                <% current_site.sidebars.each do |sidebar| %>
                    <div class="item-sidebar panel panel-default panel-toggled" data-id="<%= sidebar.id %>">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                <%= sidebar.name %><br>
                                <small class="text-muted"><%= sidebar.description %></small>
                            </h3>
                            <ul class="panel-controls">
                                <li><a href="<%= edit_zerocms_admin_appearances_widgets_sidebar_path(sidebar) %>" class="panel-edit ajax_link" title="<%= t('zerocms.admin.button.edit')%>"><span class="fa fa fa-edit"></span></a></li>
                                <li><%= link_to raw('<span class="fa fa-times text-danger"></span>'), zerocms_admin_appearances_widgets_sidebar_path(sidebar), method: :delete, data: { confirm: t('zerocms.admin.message.delete_item') }, class: "panel-delete", title: "#{t('zerocms.admin.button.delete')}" %></li>
                                <li><a class="panel-collapse" href="#"><span class="fa fa-angle-down"></span></a></li>
                            </ul>
                        </div>
                        <div class="sidebar-body panel-body" data-id="<%= sidebar.id %>">
                            <% sidebar.assigned.each do |assign| %>
                                <%= render partial: "zerocms/admin/appearances/widgets/assign/form", locals: {sidebar: sidebar, assigned: assign, widget: assign.widget} %>
                            <% end %>
                        </div>
                    </div>
                <% end %>
            </div>
        </div>
    </div>
</div>